<?php
if($access_control != "924y39c9vns8r73"){ header("location:../"); }
if($_SESSION["sgm_master"] != 1){
    header("location:?pag=");
}
include_once "controle/servico.php";
?>
                <?php if($readonly == ''){
                    echo "<h1>Novo Serviço</h1>";
                }else{
                    echo "<h1>Alterar Serviço</h1>";
                }?>
                
                <form action="" method="post" class="formulario">
                    <fieldset>
                        <legend>Serviço</legend>
                        <div>
                            <label class="campos"><span>*</span> Nome: </label>
                            <input type='text' value='<?php echo $servico->get_nome(); ?>' name='nome' id='nome1'>
                            <?php if($msg_erro["nome"] != ''){ echo "<div class='erro'>".$msg_erro["nome"]."</div>";}?>
                        </div>
                        <div>
                            <label class="campos">Duração:</label>
                            <input type='text' value='<?php echo $servico->get_tempo(); ?>' name='tempo' id='tempo' maxlength="8" OnKeyPress="formatar(this, '00:00:00')">
                            <?php if($msg_erro["tempo"] != ''){ echo "<div class='erro'>".$msg_erro["tempo"]."</div>";}?>
                        </div>
                        <div id="dv_valor">
                            <label class="campos">Valor: </label>
                            <input type='text' value='<?php echo $servico->get_valor(); ?>' name='valor' id='valor'>
                            <?php if($msg_erro["valor"] != ''){ echo "<div class='erro'>".$msg_erro["valor"]."</div>";}?>
			</div>
                    </fieldset>
                    <button type='submit' name='btn_salvar' value='Salvar' class="botao">Salvar</button>
                </form>